package com.home766.dao.impl;

import com.home766.dao.ReleaseSystemDao;
import com.home766.entity.ReleaseSystem;
import net.biz.dao.NativeBaseDao;
import net.biz.dao.impl.BaseDaoImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository("releaseSystemDaoImpl")
public class ReleaseSystemDaoImpl extends BaseDaoImpl<ReleaseSystem,Long> implements ReleaseSystemDao{
	@Autowired
	private NativeBaseDao nativeBaseDao;

	@Override
	public ReleaseSystem getSigle() {
		// TODO Auto-generated method stub
		String sql = " select re.content as content,re.end_date as end_Date,re.id as id,re.state as state from 766_release_system re where re.end_date >= SYSDATE() and state=1 ORDER BY re.end_date LIMIT 1 ";
		Map<String,Object> tempMap = new HashMap<String, Object>();
		return nativeBaseDao.findOne(sql, tempMap, ReleaseSystem.class);
	}
}
